package com.ld.hpfs.common.utils;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;

public final class PropertyUtil {
    private static Properties   propertie;

    private static final Logger log = Logger.getLogger(PropertyUtil.class);

    public static Properties init() {

        if (propertie == null) {
            propertie = new Properties();
            try {
                propertie = PropertiesLoaderUtils.loadProperties(new ClassPathResource(
                        "config/others/config.properties"));
            } catch (FileNotFoundException ex) {
                log.error(ex.getMessage());
            } catch (IOException ex) {
                log.error(ex.getMessage());
            }
        }
        return propertie;

    }
}
